package com.gy.hsim.bservice.userGroupingManagement.service;

import java.util.Date;
import java.util.List;

import com.gy.hsim.bservice.userGroupingManagement.bean.Group;
import com.gy.hsim.bservice.userGroupingManagement.bean.GroupVerify;
import com.gy.hsim.bservice.userGroupingManagement.bean.Member;
import com.gy.hsim.bservice.userGroupingManagement.bean.Notice;
import com.gy.hsim.bservice.userGroupingManagement.bean.PushGroupMsgBody;

/**
 * 
 * @ClassName: GroupService
 * @Description: 组群服务接口 
 * @author quanrj 
 * @date 2015-12-11 上午 10:11:08
 */
public interface GroupService {
	//添加群接口
	public int addGroup(Group group) throws Exception;
	
	//设置群Id
	public String setGroupId(String groupCreator) throws Exception;
	
	//根据用户资源号信息查询对应的群ID信息接口
	public List<Group> queryGroupIdByUserId(Group group) throws Exception;
		
	//更新群信息接口
	public int updateGroupInfo(Group group) throws Exception;
	
	//用户申请加入群前根据各种参数查询群信息接口
	public List<Group> queryGroupInfoByGroupParam(Group group) throws Exception;
	
	//根据群ID查询群信息接口
	public List<Group> queryGroupInfoByGroupId(Group group) throws Exception;
	
	//根据用户ID查询群信息，查询用户创建的群接口
	public List<Group> queryGroupInfoByUserId(Group group) throws Exception;
	
	//删除群接口
	public int deleteGroup(Group group) throws Exception;
	
	//把用户加入群成员表中接口
	public int addUserIntoGroup(Member member) throws Exception;
	
	//拒绝用户加入群成员表中接口
	public int refuseUserJoinGroup(Member member) throws Exception;
	
	//群主删除（解散）群的时候在群成员信息中把群成员删除接口
	public int deleteAllMemberInGroup(Member member) throws Exception;
	
	//更新群成员信息接口
	public int updateMemberInfo(Member member) throws Exception;
	
	//查询用户所在的群信息接口，查询用户加入的群memberRole传"N",查询用户管理的群memberRole传"M",查询用户创建的群memberRole传"H"
	public List<Group> queryGroupInfoUserJoin(Member member) throws Exception;
	
	//根据群ID查询群的成员信息接口
	public List<Member> queryMemberInfoByGroupId(Member member) throws Exception;
	
	//根据群ID查询群解散后的成员信息接口
	public List<Member> queryMemberInfoAfterGroupDelete(Member member) throws Exception;
	
	//根据群ID查询群的所有管理员信息接口
	public List<Member> queryAllManagerInfoByGroupId(Member member) throws Exception;
	
	//查询用户在某个群是否被禁言接口
	public String queryUserSilenceFlag(Member member) throws Exception;
	
	//查询用户在某个群的角色接口
	public String queryUserRoleInGroup(Member member) throws Exception;
	
	//查询用户是否已经在某个群中接口
	public int queryIfUserInGroup(Member member) throws Exception;
	
	//管理员删除群成员接口
	public int deleteMemberInGroup(Member member) throws Exception;
	
	//群成员离开群
	public int memberLeaveGroup(Member member) throws Exception;
	
	//群主转让群接口
	public int memberTransferHost(Member member) throws Exception;
	
	//添加加入群的验证信息接口
	public int addGroupVerifyInfo(GroupVerify groupVerify) throws Exception;
	
	//对验证信息进行验证接口
	public int updateGroupVerifyInfo(GroupVerify groupVerify) throws Exception;
	
	//查询用户在群中发送的未验证过的验证请求信息接口,如果有记录并且该验证信息未失效，则用户不能再发送加入该群请求
	public List<GroupVerify> queryUnverifiedInfoList(GroupVerify groupVerify) throws Exception;
			
	//根据verifyId查询验证信息接口
	public List<GroupVerify> queryVerifyInfoByVerifyId(GroupVerify groupVerify) throws Exception;
	
	//修改群公告接口
	public int addNotice(Notice notice) throws Exception;
	
	//修改群公告之前先把历史公告设置为"不使用"
	public int setHisNoticeUnused(Notice notice) throws Exception;
	
	//查询群公告接口
	public List<Notice> queryNoticeInfo(Notice notice) throws Exception;
	
	//根据参数获取与当前时间相比前N天的时间，并返回格式化后的字符串
	public String getComparetDateStr(Date date,int dataDiff) throws Exception;
	
	//校验未验证的验证信息是否失效,返回值大于0说明未失效, 小于0说明失效
	public int checkVerifyInfoOutDate(String verifyReqDateStr) throws Exception;
	
	//校验群操作各种数量是否超过上限,checkType=1:校验群人数,checkType=2:校验用户创建群数,checkType=3:校验某个用户所在的群数,checkType=4:校验群管理员数
	public boolean checkNumberLimit(int checkType,Object object) throws Exception;
	
	//群推送消息发送接口
	public void groupPushMsg(Member member,int pushType) throws Exception;
	
	//根据不同操作给消息实体赋值
	public PushGroupMsgBody setPushGroupMsgBody(Member member,int pushType) throws Exception;
}
